<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>"一流攀大"年度综合考核测评系统</title>
    <link rel="stylesheet" href="/static/css/layui.css">
    <script src="/static/layui.js"></script>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2696345_ubdu47c0yba.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Rammetto+One">
    <link rel="stylesheet" href="/static/css/401.css">
</head>
<body>

<div sec:authorize="!hasRole('ROLE_ADMIN')">
    <section>
        <div class="c1"></div>
        <div class="c2"></div>
        <div class="c3"></div>
        <div class="c4"></div>
    </section>
    <section>
        <h1>抱歉，您没有权限访问该页面</h1>
        <a href="/show">点击返回</a>
    </section>
</div>

<div class="layui-layout-admin" sec:authorize="hasRole('ROLE_ADMIN')">
    <!--头部-->
    <div class="layui-header">
        <div class="layui-logo" style="width: 300px;font-size: 22px"><img src="/static/images/logo.png" width="64" height="64" alt="后台管理系统">后台管理系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href=""><img src="/static/images/1.jpg" class="layui-nav-img" th:text="${name}"></a>
                <dl class="layui-nav-child">
                    <dd><a id="changePassword">修改密码</a></dd>
                    <dd><a href="/user/logout">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <style>
        .iconset {
            margin-right: 5px;
        }
        .layui-tab-title li {
            color: #000 !important;
        }
    </style>
    <!--左侧-->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo" style="margin-right: 10px;">
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;"><i class="layui-icon layui-icon-set iconset"></i>系统管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-type="toAdd" class="subMenu layui-this" data-id="1" data-title="用户管理"
                               data-url="userList"><i
                                class="iconfont  icon-yonghu iconset"></i>用户管理</a></dd>
                        <dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="2" data-title="教学单位管理"
                               data-url="departmentList"><i class="iconfont ">
                            <svg t="1667808913338" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1784" width="17" height="17"><path d="M506.8 480.6c-13.8 0-25-11.2-25-25l-0.2-71.2c0-13.8 11.1-25 25-25.1h0.1c13.8 0 25 11.2 25 25l0.2 71.2c-0.1 13.9-11.3 25.1-25.1 25.1z" fill="#ffffff" p-id="1785"></path><path d="M436.3 531c-8.7 0-17.2-4.6-21.8-12.7-6.8-12-2.6-27.3 9.4-34.1l67.4-38.2c12.1-6.8 27.3-2.6 34.1 9.4 6.8 12 2.6 27.3-9.4 34.1l-67.4 38.2c-3.8 2.3-8.1 3.3-12.3 3.3z" fill="#ffffff" p-id="1786"></path><path d="M436.3 531c-8.7 0-17.2-4.6-21.8-12.7-6.8-12-2.6-27.3 9.4-34.1l67.4-38.2c12.1-6.8 27.3-2.6 34.1 9.4 6.8 12 2.6 27.3-9.4 34.1l-67.4 38.2c-3.8 2.3-8.1 3.3-12.3 3.3z" fill="#ffffff" p-id="1787"></path><path d="M576.7 531.1c-4.2 0-8.5-1.1-12.4-3.3l-60.8-34.9c-12-6.9-16.1-22.1-9.3-34.1 6.9-12 22.2-16.2 34.1-9.3l60.8 34.9c12 6.9 16.1 22.1 9.3 34.1-4.6 8.1-13 12.6-21.7 12.6z" fill="#ffffff" p-id="1788"></path><path d="M878.2 954H144.4c-13.8 0-25-11.2-25-25V578.8c0-13.8 11.2-25 25-25h154.3V328.6c0-8 3.9-15.6 10.4-20.3l185.5-133.4c8.6-6.2 20.2-6.3 29-0.1l189.7 133.4c6.7 4.7 10.6 12.3 10.6 20.5v225.1h154.3c13.8 0 25 11.2 25 25V929c0.1 13.8-11.2 25-25 25z m-708.8-50h683.8V603.8H699c-13.8 0-25-11.2-25-25V341.6L509.4 225.9 348.7 341.4v237.3c0 13.8-11.2 25-25 25H169.4V904z" fill="#ffffff" p-id="1789"></path><path d="M611.4 954H411.3c-13.8 0-25-11.2-25-25V695.5c0-13.8 11.2-25 25-25h200.1c13.8 0 25 11.2 25 25V929c0 13.8-11.2 25-25 25z m-175.1-50h150.1V720.5H436.3V904zM511.3 220.2c-13.8 0-25-11.2-25-25V95.1c0-13.8 11.2-25 25-25s25 11.2 25 25v100.1c0 13.8-11.2 25-25 25z" fill="#ffffff" p-id="1790"></path><path d="M599.5 120.1h-83.4c-13.8 0-25-11.2-25-25s11.2-25 25-25h83.4c13.8 0 25 11.2 25 25s-11.1 25-25 25z" fill="#ffffff" p-id="1791"></path></svg>
                        </i>教学单位管理</a></dd>
                        <dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="3" data-title="职位管理"
                               data-url="positionList"><i
                                class="iconfont">
                            <svg t="1667809345712" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2680" width="17" height="17"><path d="M678.3 294.1l-306-1.4L258.5 818l251.8 141.9 262.9-143.4-94.9-522.4zM303.8 797.6l100.7-464.7 240.3 1.1 83.7 461.2-218 118.9-206.7-116.5zM376.9 267.5l298.9-0.7 40.6-151.4c3.3-12.2 0.7-25-7-35.1-7.7-10-19.4-15.8-32-15.8h-0.1l-304.9 0.5c-12.8 0-24.5 5.9-32.2 16.1-7.7 10.2-10.1 23.1-6.5 35.4l43.2 151z m-4.7-162.1c0.1-0.1 0.2-0.1 0.3-0.1l304.9-0.5c0.1 0 0.2 0 0.3 0.1 0.1 0.1 0.1 0.2 0.1 0.3L645.1 227l-238.1 0.5-34.9-121.8c0-0.2 0-0.2 0.1-0.3z" fill="#ffffff" p-id="2681"></path><path d="M379.008 600.629l188.394-245.447 31.732 24.356L410.74 624.985zM405.87 723.043l188.393-245.447 31.732 24.356-188.393 245.447zM448.975 832.692L637.37 587.245l31.732 24.356-188.394 245.447z" fill="#ffffff" p-id="2682"></path></svg>
                        </i>职位管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;"><i class="iconfont">
                        <svg t="1667809463758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5951" width="17" height="17"><path d="M974.207967 392.368342c-9.716292 0-17.59268 7.876388-17.59268 17.59268l0 578.518996L35.20685 988.480019 35.20685 67.071581 656.226822 67.071581c9.716292 0 17.59268-7.876388 17.59268-17.59268 0-9.716292-7.876388-17.59268-17.59268-17.59268L17.61417 31.886221 0.021489 31.886221l0 17.59268 0 956.593797 0 17.59268 17.59268 0 956.593797 0 17.59268 0 0-17.59268L991.800647 409.961022C991.800647 400.245753 983.924259 392.368342 974.207967 392.368342z" p-id="5952" fill="#ffffff"></path><path d="M177.046299 354.049618l255.091816 0c9.716292 0 17.59268-7.876388 17.59268-17.59268 0-9.716292-7.876388-17.59268-17.59268-17.59268L177.046299 318.864258c-9.716292 0-17.59268 7.876388-17.59268 17.59268C159.453618 346.173231 167.330006 354.049618 177.046299 354.049618z" p-id="5953" fill="#ffffff"></path><path d="M495.910557 510.183631 177.046299 510.183631c-9.716292 0-17.59268 7.876388-17.59268 17.59268s7.876388 17.59268 17.59268 17.59268l318.864258 0c9.716292 0 17.59268-7.876388 17.59268-17.59268S505.626849 510.183631 495.910557 510.183631z" p-id="5954" fill="#ffffff"></path><path d="M159.453618 719.094662c0 9.716292 7.876388 17.59268 17.59268 17.59268l637.729539 0c9.716292 0 17.59268-7.876388 17.59268-17.59268 0-9.716292-7.876388-17.59268-17.59268-17.59268L177.046299 701.501982C167.330006 701.501982 159.453618 709.378369 159.453618 719.094662z" p-id="5955" fill="#ffffff"></path><path d="M1017.542938 4.235464c-7.377014-6.323009-18.482957-5.468548-24.805966 1.908466L610.099249 452.554096c-6.323009 7.377014-5.468548 18.482957 1.908466 24.805966 7.377014 6.323009 18.482957 5.468548 24.805966-1.908466L1019.451404 29.04143C1025.774413 21.665439 1024.919952 10.558473 1017.542938 4.235464z" p-id="5956" fill="#ffffff"></path></svg>
                    </i>评分管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="4" data-title="部门管理"
                               data-url="unitList"><i class="iconfont ">
                            <svg t="1667809381173" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3670" width="17" height="17"><path d="M512 128 128 326.4 896 326.4Z" p-id="3671" fill="#ffffff"></path><path d="M128 832l768 0 0 64-768 0 0-64Z" p-id="3672" fill="#ffffff"></path><path d="M230.4 384l0 384c0 19.2 12.8 32 32 32s32-12.8 32-32L294.4 384c0-19.2-12.8-32-32-32S230.4 364.8 230.4 384z" p-id="3673" fill="#ffffff"></path><path d="M390.4 384l0 384c0 19.2 12.8 32 32 32s32-12.8 32-32L454.4 384c0-19.2-12.8-32-32-32S390.4 364.8 390.4 384z" p-id="3674" fill="#ffffff"></path><path d="M569.6 384l0 384c0 19.2 12.8 32 32 32s32-12.8 32-32L633.6 384c0-19.2-12.8-32-32-32S569.6 364.8 569.6 384z" p-id="3675" fill="#ffffff"></path><path d="M736 384l0 384c0 19.2 12.8 32 32 32s32-12.8 32-32L800 384c0-19.2-12.8-32-32-32S736 364.8 736 384z" p-id="3676" fill="#ffffff"></path></svg>
                        </i>部门管理</a></dd>
                        <dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="5" data-title="增量一流考核"
                               data-url="push"><i class="iconfont">
                            <svg t="1667809418230" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4922" width="17" height="17"><path d="M375.712 636v247.984h-148.8V636h148.8z m-99.2 198.384h49.6V685.6h-49.6v148.784zM586.48 512v371.984h-148.8V512h148.8z m-99.2 322.384h49.6V561.6h-49.6v272.784zM797.264 388v495.984h-148.8V388h148.8z m-99.2 446.384h49.6V437.6h-49.6v396.784z m196.8 173.6H129.296c-54.56 0-99.2-44.64-99.2-99.2V164.816c0-81.84 114.96-148.8 196.8-148.8h545.568a24.784 24.784 0 1 1 0 49.6H226.896c-56.944 0-150.832 48.224-146.976 105.984 3.52 52.672 97.696 92.4 150.48 92.4h542.064a24.8 24.8 0 1 1 0 49.6H226.896c-38.08 0-120.8-14.608-147.2-38.352v633.536a49.6 49.6 0 0 0 49.6 49.6h765.568a49.6 49.6 0 0 0 49.6-49.6V239.2a49.6 49.6 0 0 0-49.6-49.584H235.568c-11.6 0-20.944-8.864-22.432-20.384l-0.064-0.496c-1.984-15.136 9.216-28.72 24.48-28.72h657.312c54.576 0 99.2 44.64 99.2 99.184v669.584c0 54.56-44.64 99.2-99.2 99.2z" p-id="4923" fill="#ffffff"></path></svg>
                        </i>增量一流考核</a></dd>
                        <dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="6" data-title="满意度测评"
                               data-url="pushGrade"><i class="iconfont">
                            <svg t="1670483363773" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2133" width="17" height="17"><path d="M319.786667 461.866667H151.893333c-16 0-29.866667 13.226667-29.866666 29.866666 0 16 13.226667 29.866667 29.866666 29.866667h167.893334c16 0 29.866667-13.226667 29.866666-29.866667-0.213333-16.64-13.866667-29.866667-29.866666-29.866666z m0 0" fill="#ffffff" p-id="2134"></path><path d="M798.72 837.12l-5.76 2.346667v29.226666c0 41.173333-33.706667 75.093333-75.093333 75.093334H173.013333c-41.173333 0-75.093333-33.706667-75.093333-75.093334V155.946667c0-41.173333 33.706667-75.093333 75.093333-75.093334h544.853334c41.173333 0 75.093333 33.706667 75.093333 75.093334v29.226666l5.76 2.346667c21.76 8.106667 42.453333 18.346667 61.226667 30.293333l13.226666 8.106667V134.613333c0-74.026667-60.16-134.613333-134.613333-134.613333H151.893333C77.866667 0 17.28 60.16 17.28 134.613333v754.773334C17.28 963.413333 77.44 1024 151.893333 1024h586.88c73.813333 0 134.613333-60.16 134.613334-134.613333v-90.453334l-13.226667 8.106667c-18.986667 11.733333-39.68 22.186667-61.44 30.08z m0 0" fill="#ffffff" p-id="2135"></path><path d="M319.786667 315.093333H151.893333c-16 0-29.866667 13.226667-29.866666 29.866667 0 16.64 13.226667 29.866667 29.866666 29.866667h167.893334c16 0 29.866667-13.226667 29.866666-29.866667-0.213333-16.64-13.866667-29.866667-29.866666-29.866667z m0 293.546667H151.893333c-16 0-29.866667 13.226667-29.866666 29.866667s13.226667 29.866667 29.866666 29.866666h167.893334c16 0 29.866667-13.226667 29.866666-29.866666s-13.866667-29.866667-29.866666-29.866667z m298.026666-111.786667h53.333334v-5.76a68.906667 68.906667 0 0 0-68.693334-68.693333 68.906667 68.906667 0 0 0-68.693333 68.693333v5.76h53.333333v-5.76c0-8.533333 6.826667-15.573333 15.573334-15.573333 8.533333 0 15.573333 6.826667 15.573333 15.573333v5.76z m0 0" fill="#ffffff" p-id="2136"></path><path d="M707.626667 213.12c-165.12 0-299.093333 134.186667-299.093334 299.093333 0 165.12 134.186667 299.093333 299.093334 299.093334 165.12 0 299.093333-134.186667 299.093333-299.093334 0-164.906667-133.973333-299.093333-299.093333-299.093333z m0 523.733333c-123.733333 0-225.28-100.906667-225.28-224.64 0-123.733333 100.906667-225.28 225.28-225.28s225.28 100.906667 225.28 225.28c-0.64 123.946667-101.546667 224.64-225.28 224.64z m0 0" fill="#ffffff" p-id="2137"></path><path d="M743.68 575.36c0 20.053333-16 36.053333-36.053333 36.053333s-36.053333-16-36.053334-36.053333v-5.76h-53.333333v5.76c0 49.28 40.106667 89.386667 89.386667 89.386667 49.28 0 89.386667-40.106667 89.386666-89.386667v-5.76h-53.333333v5.76z m68.906667-152.533333a68.906667 68.906667 0 0 0-68.693334 68.693333v5.76h53.333334v-5.76c0-8.533333 6.826667-15.573333 15.573333-15.573333 8.533333 0 15.573333 6.826667 15.573333 15.573333v5.76h53.333334v-5.76c-1.066667-38.186667-31.36-68.693333-69.12-68.693333z m0 0" fill="#ffffff" p-id="2138"></path></svg>                        </i>满意度测评</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <image></image>
    <!--中间主体-->
    <div class="layui-body" id="container">
        <div class="layui-tab" lay-filter="tabs" lay-allowClose="true">
            <ul class="layui-tab-title" disabled="disabled">
            </ul>
            <div class="layui-tab-content">
            </div>
        </div>
    </div>

    <!--底部-->
    <div class="layui-footer">
        <center>"一流攀大"年度综合考核测评系统</center>
    </div>
</div>
<form class="layui-form" style="display: none" id="commentForm" onsubmit="return false" lay-filter="pushForm">
    <div class="layui-form-item" style="width: 70%;margin-top: 20px">
        <label class="layui-form-label" style="width: 130px;margin-left: 15px;color: black">修改的密码：</label>
        <div class="layui-input-block"  style="margin-left:150px">
            <input class="layui-input" id="password" name="password" minlength="2" type="password" required=""
                   aria-required="true">
        </div>
    </div>
    <div class="layui-form-item" style="width: 70%;margin-top: 20px">
        <label class="layui-form-label" style="width: 130px;margin-left: 15px;color: black">请确认密码：</label>
        <div class="layui-input-block"  style="margin-left:150px">
            <input class="layui-input" id="password1" minlength="2" type="password" required=""
                   aria-required="true">
        </div>
    </div>
</form>
<script>
    layui.use(['element','form'], function () {
        var element = layui.element;
        var layer = layui.layer;
        var form = layui.form;
        var $ = layui.$;
        $("#changePassword").on("click", function () {
            var addOpen = layer.open({
                //基本层类型
                type: 1,
                shadeClose: false,
                scrollbar: false,
                area: ['550px', '350px'],
                //标题
                title: '修改密码',
                //内容
                content: $('#commentForm'),
                //按钮
                btn: ['确定', '取消'],
                //确定按钮
                yes: () => {
                    if ($('#password').val() == $("#password1").val()) {
                        //开启loading
                        const loading = layer.load(2);
                        //获取表单内的所有值
                        var formObj = form.val('pushForm');
                        //发送数据到接口
                        $.ajax({
                            url: '/user/changePassword',
                            method: "post",
                            contentType: 'application/json;charset=utf-8',
                            data: JSON.stringify(formObj),
                            dataType: "json",
                            success: function (data) {
                                layer.close(loading);
                                if (data.data == 1) {
                                    layer.msg("修改成功");
                                    layer.close(addOpen)
                                } else {
                                    layer.alert(data.msg);
                                }
                            }
                        });
                    } else {
                        layer.msg("两次输入的密码不相同！")
                    }
                },
            });
        })
        // 配置tab实践在下面无法获取到菜单元素
        $('.subMenu').on('click', function () {
            var dataid = $(this);
            //这时会判断右侧.layui-tab-title属性下的有lay-id属性的li的数目，即已经打开的tab项数目
            if ($(".layui-tab-title li[lay-id]").length <= 0) {
                //如果比零小，则直接打开新的tab项
                active.tabAdd(dataid.attr("data-url"), dataid.attr("data-id"), dataid.attr("data-title"));
            } else {
                //否则判断该tab项是否以及存在
                var isData = false; //初始化一个标志，为false说明未打开该tab项 为true则说明已有
                $.each($(".layui-tab-title li[lay-id]"), function () {
                    //如果点击左侧菜单栏所传入的id 在右侧tab项中的lay-id属性可以找到，则说明该tab项已经打开
                    if ($(this).attr("lay-id") == dataid.attr("data-id")) {
                        isData = true;
                    }
                })
                if (isData == false) {
                    //标志为false 新增一个tab项
                    active.tabAdd(dataid.attr("data-url"), dataid.attr("data-id"), dataid.attr("data-title"));
                } else {
                    active.tabDelete(dataid.attr("data-id"))
                    active.tabAdd(dataid.attr("data-url"), dataid.attr("data-id"), dataid.attr("data-title"));
                }
            }
            //最后不管是否新增tab，最后都转到要打开的选项页面上
            active.tabChange(dataid.attr("data-id"));
        });

        var active = {
            //在这里给active绑定几项事件，后面可通过active调用这些事件
            tabAdd: function (url, id, name) {
                //新增一个Tab项 传入三个参数，分别对应其标题，tab页面的地址，还有一个规定的id，是标签中data-id的属性值
                //关于tabAdd的方法所传入的参数可看layui的开发文档中基础方法部分
                //tabs:中间主体的fiter名
                element.tabAdd('tabs', {
                    title: name,
                    content: '<iframe data-frameid="' + id + '" frameborder="0" src="' + url +
                        '" style="width:100%;height:95%;"></iframe>',
                    id: id //规定好的id
                })
                FrameWH(); //计算ifram层的大小
            },
            tabChange: function (id) {
                //切换到指定Tab项
                element.tabChange('tabs', id); //根据传入的id传入到指定的tab项

                // $.each($('iframe'),function (index,dom){
                //     dom.contentWindow.location.reload();
                // })
            },
            tabDelete: function (id) {
                element.tabDelete("tabs", id); //删除
            }
        };

        function FrameWH() {
            var h = $(window).height();
            h -= 150;
            $("iframe").css("height", h + "px");
        }

        layer.ready(function (){
            active.tabAdd("userList",1,"用户管理")
            active.tabChange(1)
        })
    });

</script>
</body>
</html>